var app = new Vue({
    el: ".mappheader",
    created() {
    },
    data() {
      return {
        searchnum:1,
        showdrop: false,
        searchkey:'',
        isactive: null,
        searcharr:['百度','必应','搜狗'],
        searchstr:'百度'
      };
    },
    create(){
    },
    mounted() {
        let arr = window.location.href.split('/')
        let str = arr[arr.length-1]
        if(str == 'm'){
            this.isactive=0 
        }else if(str == 'mnavigation'){
            this.isactive=1
        }else if(str == 'mychoice'){
            this.isactive=2
        }
    },
    methods: {
        chiosesearch(val,str){
            this.searchnum = val
            this.showdrop = false
            this.searchstr = str
        },
        search() {
            if (this.searchkey == "") {
                return;
            }
            if(this.searchnum == 0){
                window.open(`https://www.baidu.com/s?wd=${this.searchkey}`, '') 
            }else if(this.searchnum == 1){
                window.open(`https://cn.bing.com/search?q=${this.searchkey}`,'')
            }else if(this.searchnum == 2){
                window.open(`https://www.sogou.com/web?query=${this.searchkey}`,'')
            }
        }
    }
});
  